﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DBToExcel.Model
{
    public class MRowInfo
    {
        /// <summary>
        /// 当前行索引
        /// </summary>
        public int NowRowIndex { get; set; }

        /// <summary>
        /// 当前列索引
        /// </summary>
        public int NowCellIndex { get; set; }

        /// <summary>
        /// 当前列的值
        /// </summary>
        public object NowCellValue { get; set; }

        /// <summary>
        /// 当前字段
        /// </summary>
        public string NowFieldName { get; set; }

        /// <summary>
        /// 列集合
        /// </summary>
        public List<string> Cells { get; set; }

        /// <summary>
        /// 当前行数据
        /// </summary>
        public Dictionary<string,object> NowRowData { get; set; }

        /// <summary>
        /// 上一行数据
        /// </summary>
        public Dictionary<string,object> PreRowData { get; set; }

        /// <summary>
        /// 所有填入excel的数据
        /// </summary>
        public List<Dictionary<string,object>> ExcelData { get; set; }

        /// <summary>
        /// 打印日志事件
        /// </summary>
        public event Action<string> PrintLogEvent;

        /// <summary>
        /// 打印日志
        /// </summary>
        /// <param name="log"></param>
        public void PrintLog(string log) {
            if (PrintLogEvent!=null)
            {
                PrintLogEvent(log);
            }
        }
    }
}
